#ifndef VM_SWAP_H
#define VM_SWAP_H

#include "vm/frame.h"
#include "vm/page.h"

#include <list.h>
#include "threads/palloc.h"
#include "threads/thread.h"
#include "devices/block.h"
#include "userprog/pagedir.h"

struct slot {
        struct list_elem elem;
        uint8_t *upage;
        tid_t pid;
        block_sector_t slid;
};

void  swap_init(void);
void* evict(void *upage,struct thread* newown);
bool readback(void* upage,void* fp);
struct list_elem *swap_find (void *upage);
#endif
